package com.xiaolin.designmode.memento;

/**
 * @ClassName Originator
 * @Description 发起人角色
 * @Detail detail
 * @Author MyPC
 * @Date 2020/11/9
 * @Version 1.0
 */
public class Originator {
    private String state;

    public void setState(String state) {
        this.state = state;
    }

    public String getState() {
        return state;
    }

    public Memento createMemento(){
        return new Memento(this.state);
    }

    public void restoreMemento(Memento memento){
        this.setState(memento.getState());
    }
}
